A stacking system is a logical device formed by connecting two or more devices, providing high availability, high scalability and streamlined management for users. Devices in a stacking system are connected by stack cables in a daisy chain connection mode or ring connection mode.
The present invention comprises: when the daisy chain topology is stable, a device joins the stacking system and the topology changes to ring topology. As shown in FIG. 1, the topology of the original stacking system is a daisy chain topology formed by devices S2, S1, S8, S7, S6, S5 and S4. When the topology becomes stable, device S3 joins the stacking system, and the topology changes to ring topology. In this case, the shortest forwarding path should be re-calculated, and traffic should be switched if necessary. The current technology implements this in the is following ways:
When the daisy chain topology of the stacking system is stable, each device in the stacking system calculates the shortest forwarding path and packet discarding rules. When device S3 joins the stacking system, if a stack port of S3 is blocked, meaning it stops sending and receiving packets. As illustrated in FIG. 2, the topology is considered as a daisy chain topology, and traffic between S2 and S4 is forwarded over path S2-S1-S8-S7-S6-S5-S4. Master S1 restores the configuration of device S3 through path S1-S2-S3. After configuration restoration is completed, the blocked stack port of S3 restores to the forwarding state, and master S1 updates the stored topology information, re-calculates the shortest forwarding path and switches the traffic, and then notifies other devices of the topology change through sending notification packets. Upon receiving the notification packets, each device re-calculates the shortest forwarding path and switches the traffic. In this way, traffic between S1 and S4 is switched from path S1-S8-S7-S6-S5-S4 to path S1-S2-S3-S4.
Although the method in the current technology can implement traffic switching from the daisy chain topology to ring topology, traffic interruption will occur between some devices because master S1 sends notification packets for topology change to trigger other devices to calculate the shortest forwarding path after calculating its own shortest forwarding path. For example, after master S1 calculates its shortest forwarding path, the forwarding path for switching traffic from S1 to S4 changes to S1-S2-S3-S4; however, when calculation of the shortest forwarding path of S2 is not completed, traffic is forwarded over path S2-S1-S8-S7-S6-S5-S4, and this results in traffic interruption between S1 and S4.